﻿<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="template" content="OPCFMasterPage.htt" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="rh-authors" content="Nathan Pocock" />
<meta name="generator" content="Adobe RoboHelp 9" />
<title>Step 1 - New Project</title>
<link rel="StyleSheet" href="default.css" type="text/css" />
</head>

<body>
<h1>Server Development Tutorial</h1>
<h2>Step 1 - Creating a new Server Project</h2>
<p>In this section you will copy an existing project, rename it, add it 
 to the existing solution, and then rename all resources as appropriate.</p>
<ol type="1">
	<li><p>Open <?rh-udv_start name="vsnet" ?>Visual Studio .NET 2008<?rh-udv_end ?> 
	 and then open the Sample Applications Source Code solution:<br />
	<span style="font-family: 'Courier New', monospace;">OPC UA 1.02 .NET 
	 StackAndSamples [xxx]\UA Quickstart Applications.sln</span></p></li>
	<li><p>We will now duplicate the Reference Server project: </p></li>
	<ol type="1">
		<li><p>Now switch to Windows Explorer.</p></li>
		<li><p>Locate the &quot;Reference Server&quot; project, which is 
		 in the following default location:<br />
		<span style="font-family: 'Courier New', monospace;">OPC UA 1.02 
		 .NET StackAndSamples [xxx]\SampleApplications\Workshop\Reference</span></p></li>
		<li><p>Right-click on the &quot;Server&quot; directory and choose 
		 Copy.</p></li>
		<li><p>In the same &quot;reference&quot; folder you will right-click 
		 and then Paste.</p></li>
		<li><p>A duplicate folder called &quot;Server - copy&quot; will 
		 be created. Rename this folder as appropriate.</p></li>
		<li><p>Double-click the new folder to open it.</p></li>
		<li><p>Rename the file &quot;Reference Server.csproj&quot; as appropriate, 
		 e.g. &quot;MyServer&quot;.<br />
		Note: this will <span style="text-decoration: underline; ">not</span> 
		 rename all resources as necessary.</p></li>
		<li><p>Switch back to <?rh-udv_start name="vsnet" ?>Visual Studio .NET 2008<?rh-udv_end ?>.</p></li>
	</ol>
	<li><p>Within this solution you can Add the project that you copied 
	 in the previous step:</p></li>
	<ol type="1">
		<li><p>Right-click on the Reference&quot; folder that is visible 
		 within the Solution Explorer, choose Add Existing Project.</p></li>
		<li><p>Using the navigation window locate, highlight, and select 
		 the *.csproj that you renamed in step 2.7 above.</p></li>
		<li><p>The newly added project will be added to the solution and 
		 visible in the solution explorer.</p></li>
	</ol>
	<li><p>Now rename the remaining resources as appropriate: </p></li>
	<ol type="1">
		<li><p>Assembly name:</p></li>
		<ol type="1">
			<li><p>Open the properties of the newly added project.</p></li>
			<li><p>Modify the &quot;Assembly name&quot;, e.g. &quot;Quickstarts.MyServer&quot;.</p></li>
			<li><p>Modify the &quot;Default namespace&quot;, e.g. &quot;Quickstarts.MyServer&quot;.<br />
			 <br />
			<span style="font-weight: bold;">Note:</span> The removal of 
			 &quot;Quickstarts.&quot; from the namespace will require additional 
			 work to help the compiler locate referenced classes; in some 
			 cases you will need to modify the &quot;using&quot; references 
			 to properly specify the locations of referenced classes.</p></li>
		</ol>
		<li><p>Product Renaming:</p></li>
		<ol type="1">
			<li><p>Within the current project, conduct a search and replace 
			 &quot;ReferenceServer&quot; with the intended name, e.g. &quot;MyServer&quot;.</p></li>
			<li><p>Again, within the same project conduct a search and 
			 replace &quot;Reference Server&quot; with the intended name, 
			 e.g. &quot;My Server&quot;.</p></li>
			<li><p>You may also with to rename the &quot;OPC Foundation&quot; 
			 branding as your own company, in which case simply search 
			 and replace &quot;&quot;OPC Foundation&quot; (note the quote 
			 before OPC) with your company name, e.g. &quot;My Company&quot;.</p></li>
			<li><p>Rename the configuration file &quot;Quickstarts.ReferenceServer.Config.Xml&quot;, 
			 e.g. &quot;Quickstarts.MyServer.Config.Xml&quot;.</p></li>
		</ol>
		<li><p>Compile the application and run it to make sure that it 
		 opens and that the application name matches your expectations. 
		 </p></li>
		<li><p>If you are an inquisitive person you might try connecting 
		 a UA Client to your newly created UA Server.</p></li>
	</ol>
</ol>
<p>At this point you have created a clone of the <a href="Overview_referenceServer.htm">Reference 
 Server</a>. In the next section you will define the <a href="Step_2_-_Address_Space.htm">address 
 space</a>.</p>
</body>
</html>
